#!/usr/bin/python3
#! -*- coding:utf-8 -*-

import random
from caltime import runtime


@runtime
def insert_sort(ls):
    for i in range(1, len(ls)):
        tmp = ls[i]
        j = i - 1
        while j >= 0 and ls[j] >= tmp:
            ls[j + 1] = ls[j]
            j -= 1
        ls[j + 1] = tmp
        

lst = [random.randint(-100, 100) for _ in range(10)]
print('原列表>>>', lst)
insert_sort(lst)
print('排序后的列表>>>', lst)

